﻿<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->

<common:LayoutAwarePage
    x:Class="Tiles.SendTextTile"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Tiles"
    xmlns:common="using:SDKTemplate.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid x:Name="LayoutRoot" Background="White" HorizontalAlignment="Left" VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid x:Name="Input" Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <StackPanel>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" FontWeight="SemiBold" Margin="0,0,0,10">
                    Tiles are the representation and launching point of an application from the Start screen. An app can update
                    its tile using live tile and badge notifications in order to display new, relevant, and tailored content to the user.
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap">
                    Tile notifications are specified in an XML format and contain text and images in a pre-defined layout.
                    <LineBreak/>
                    Applications must always include a medium (Square150x150) logo in the manifest. Similarly, if an application wants to use wide (Wide310x150) tile templates, it must include a wide (Wide310x150) logo with it as well.
                    Applications that want to use large (Square310x310) tile templates must include both Wide310x150 and Square310x310 logos. Each application automatically supports the small (Square70x70) tile size by simply shrinking down the Square150x150 logo. An application can override this logo in the manifest if it so chooses.
                    When sending live tile notifications, it is strongly recommended to send bindings for all supported tile sizes in each payload since users decide what size your application's tile will be. Note that there is no binding for the small (Square70x70) tile size, as this size does not support live tile updates (but does support badge updates).
                    <LineBreak />
                    <LineBreak />
                    Given below are two different use cases. Before you send the notifications, make sure that you pin the tile to your Start screen.
                    Once you send the notification, check how the pinned tile shows those updates.
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}"  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,20,0,0" FontWeight="SemiBold">
                    First Scenario:
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap">This scenario demonstrates how you can send a tile notification with just text using the Notifications Extensions Library methods.</TextBlock>
                <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
                    <Button x:Name="UpdateTileWithText" Content="Send tile notification with text" Click="UpdateTileWithText_Click"/>
                    <Button x:Name="ClearTile" Content="Clear tile" Click="ClearTile_Click"/>
                </StackPanel>
                <TextBlock Style="{StaticResource BasicTextStyle}"  VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,20,0,0" FontWeight="SemiBold">
                    Second Scenario:
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap">
                    Since notifications are simply XML, you can create them in many different ways. For example, here we create notifications by constructing strings.
                    As mentioned above, it's always a good idea to send XML for all the supported tile sizes for the best user experience.
                </TextBlock>
                <StackPanel Margin="0,10,0,0">
                    <Button x:Name="UpdateTileWithTextWithStringManipulation" Content="Send tile notification created with strings" Click="UpdateTileWithTextWithStringManipulation_Click"/>
                </StackPanel>
            </StackPanel>
        </Grid>

        <Grid x:Name="Output" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1">
            <TextBlock x:Name="OutputTextBlock" Text="" TextWrapping="Wrap" Style="{StaticResource BasicTextStyle}" IsTextSelectionEnabled="True"/>
        </Grid>

        <!-- Add Storyboards to the visual states below as necessary for supporting the various layouts -->
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="DefaultLayout"/>
                <VisualState x:Name="Below768Layout"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>

</common:LayoutAwarePage>